
#include "socket/tcpip/Socket_TCPIP.h"
#include "io/epoll/Epoll_Accept.h"



typedef struct People
{
    char name[4];
    int age;
} people;

void procExit01(void)
{
    printf("\n before main process exit..! \n");
}

/*
 * 
 */
int main(int argc, char** argv) {

    printf("Start!!  \n");
    
    //char dd[] = "[\"name\":\"kisme\"],[\"password\":\"123456\"]";
    
    //HTTP_Util<People> _httpUtil;
    //_httpUtil.http_package(dd);

    Socket_TCPIP *serSocket = new Socket_TCPIP(8555);
    serSocket->socket_bind();
    serSocket->socket_listen();
    serSocket->setNonblocking(serSocket->m_sInfo->fd);
    
    Epoll_Accept *epoll = new Epoll_Accept(serSocket->m_sInfo->fd);
    
    epoll->Configure();
    epoll->Listening();
    
    //People* peoples = new People[5];
    //memcpy(peoples[0].name, "ok", 2);
    //peoples[0].age = 24;
    //memcpy(peoples[1].name, "jo", 2);
    //peoples[1].age = 25;
    //memcpy(peoples[2].name, "gy", 2);
    //peoples[2].age = 52;
    //memcpy(peoples[3].name, "ri", 2);
    //peoples[3].age = 12;
    //memcpy(peoples[4].name, "wv", 2);
    //peoples[4].age = 18;
    
    //ipc_mmap->memwrite(peoples);
    
    //printf("end \n");
    
    //ipc_mmap->memsync();
    //ipc_mmap->menunmap();
    
    
    
    
    
    
    
    

    if(atexit(procExit01)!=0)
    {
        printf("atexit method failed..! \n");
    }

    return (EXIT_SUCCESS);
}
